Add a timeout for pickle resolution to prevent indefinitely stuck builds #278
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to jenkinsci/workflow-api-plugin#357 and jenkinsci/workflow-api-plugin#347. Even though the fix there should prevent stuck builds from leaking memory of other builds, it is still worth trying to prevent builds from getting stuck in the first place.
This PR adds a hard timeout to pickle resolution. I do not care much about the exact timeout, I just want to pick a value that doesn't break pickle resolution in non-pathological cases. The case described in jenkinsci/workflow-api-plugin#357 involved a build repeatedly resuming and trying to resolve a
FilePathPickle
that was never going to come back for around a month.If preferred this could be done in
CpsFlowExecution.loadProgramAsync
orTryRepeatedly
instead.Testing done
Submitter checklist